<?php

/**
 * Created by allen.qiang <allen.qiang@fistforward.com>
 * Date: 15-1-14
 * Time: 下午2:50
 * FUN-AC-0028
 * 咖啡验收
 */
quanli_require('module/base/system/itemHandler.class.php');//载入字典操作类
class pa_acceptanceCoffee {


    public function execute() {
        global $G_SHOP ;

        if (isset($_REQUEST['operFlg'])) {

            switch($_REQUEST['operFlg']) {

                case 1: //咖啡验收
                    $this->coffee();
                    break;
                case 2://咖啡验收列表
                    $this->coffeeList();
                    break;
                default:
                    $G_SHOP->smarty->assign('error_msg', '参数错误，请审核后再操作');
                    $G_SHOP->smarty->display('comm/error.tpl');
            }
        }
    }

    /*
     * 咖啡验收列表
     */
    public function coffeeList(){

        global $G_SHOP;
        $send_date=date("Y-m-d",time());

        $itemHandler=new itemHandler();
        $arg_array=array(
            'item'=>36
        );
        $dunchinfo=$itemHandler->searchItemList($arg_array);


        //获取下午茶咖啡信息
        $coffeeSKU= $dunchinfo[0]->itemName;
        $coffeeSql="select * from goods_sale where product_code in(".$coffeeSKU.")";
        $coffeeInfo=$G_SHOP->DBCA->stmt_query($coffeeSql);




        $G_SHOP->smarty->assign('coffeeInfo', $coffeeInfo);
        $G_SHOP->smarty->assign('send_date', $send_date);
        $G_SHOP->smarty->display('dunch/coffeeList.tpl');

    }






}